reorganized to fit ruby best practices