refactor methods to be more readable