CFY-1308 Refactoring, improvements and falke8