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