Divide original functions.js into four file. Each file is responsible for one thing - understandable by its name. main_functions.js unite these files.