Moved profile code into separate plugin module