Refactored folder structure & directory code