adding foundation and refactoring for ease of structure