moved some resources, and some minor refactoring