Moved app logic, added utils for removing empty lines