moved configuration and some functions to behaviour