restructred files and moved to cmake for build