First functional tests and cleaned up