Less code duplication
clean up code