refactored build file, config and startup script