Moved helper functions to core. PEP8.
WIP