refactored methods a little