refactor methods into appropriate locations