simplification and code cleanup where possible, to improve code climate score