split code in some functions to reduce cyclomatic complexity
split code in some functions to reduce cyclomatic complexity

movabletype/mt-plugin-Loupe,movabletype/mt-plugin-Loupe,movabletype/mt-plugin-Loupe,movabletype/mt-plugin-Loupe,movabletype/mt-plugin-Loupe