Moved code to subdir. Cleaned up the code.