Removed private methods and added unit tests