refactor .et build server code
add unit testing