logging added and components moved to lib