refactor code, allow building for development and production