small refactoring for 64 bit platforms support, especially for FPC