refactor code and remove servant.config due to no longer necessary