Complex cleanup

based on code climate review