refactored to appserver.io coding standards