Refactored file structures and classes