split profile operations into a class (fixes #14)