renamed long methods to reduce code bloat