Refactored out code, some problematic features