Fix path and add __main__ section.
Use inheritance to mantain less code.