Reorganize sources
Clean up warnings
Refactor