moved control to lib