Shared functions was separated from main file. Some source files were renamed.