Refactor, build on top of flatstrap