did a lot of refactoring to make increase performance and useability