Added few tests and cleanup