Added environment support for application, added tests, updated method names for better readability