Refactored a bit. Merged 4 into large files