Replace helper methods

Replaced helper methods to a separate file