Move codes to src/ correctly.
Use a simple but not strict way to throw logic_error.