Code cleanup
Profiles support