Refactor code to follow houndci coding guidelines