add code coverage and rails best practices